import { PRIORITY_VIEW } from "../../../Core/CoreDefine";
import { GCtrl } from "../../../Core/GCtrl";
import { GListView } from "../../../Core/GView/GListView";
import GPage from "../../../Core/GView/GPage";
import { CMsg, LISTENTTYPE } from "../../Common/Define";
import { Res } from "../../Common/UIResources";
import GameMgr from "../../Logic/GameMgr";
import { IHeroSort, SHeroSort } from '../../Logic/HeroMgr';
import HeroCardItem from "./HeroCardItem";

const { ccclass, property, menu, executeInEditMode } = cc._decorator;
@ccclass @menu('View/Hero/BageView')

export default class BageView extends  GPage {

    private _curPageIndex: number = 0;
    onPageIn() {

    }

    onGLoad() {
        this.refresh();
    }

    refresh(){

    }

    /**0 武将，1图鉴，2编队 */
    protected btnPage(CustomEventData, index) {
        this._curPageIndex = Number(CustomEventData.node._name);
        //GCtrl.ES.emit(CMsg.client.home.onBattleItem, -1);
        // this.dealWithData();

        this.refresh();
    }

    /**初始每个卡牌 */
    public onItemSetter(item: HeroCardItem, data: SHeroDataRaw | IHeroData, index: number) {
        item.init(data, index, LISTENTTYPE.listent2);
    }
}